package model.promo;
// Generated Feb 5, 2013 11:50:02 PM by Hibernate Tools 3.2.1.GA


import java.math.BigDecimal;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Transient;
import model.inventory.Item;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
 * MstPromoDisitem generated by hbm2java
 */
@Entity
@Table(name="mst_promo_disitem", schema="promo")
@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)
public class PromoDisitem  implements java.io.Serializable {


     private long id;
     private Promo promo;
     private Item item;
     private String jenisDiskon;
     private String caraHitung;
     private Integer batas;
     private BigDecimal nilai;
     private Boolean updated=false;
     

    public PromoDisitem() {
        this.item = new Item();
        this.promo = new Promo();
        this.nilai = BigDecimal.ZERO;
    }
       
    @Id 
    @SequenceGenerator(name="promo_disitem_seq", sequenceName="promo.mst_promo_disitem_id_seq", allocationSize=1)
    @GeneratedValue(strategy= GenerationType.SEQUENCE, generator="promo_disitem_seq")
    @Column(name="id", unique=true, nullable=false)
    public long getId() {
        return this.id;
    }
    
    public void setId(long id) {
        this.id = id;
    }
    
    @ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="promo_id") 
    public Promo getPromo() {
        return this.promo;
    }
    
    public void setPromo(Promo promo) {
        this.promo = promo;
    }
    
    @ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="item_id") 
    public Item getItem() {
        return item;
    }

    public void setItem(Item item) {
        this.item = item;
    }

    @Column(name="jenis_diskon", length=1)
    public String getJenisDiskon() {
        return jenisDiskon;
    }

    public void setJenisDiskon(String jenisDiskon) {
        this.jenisDiskon = jenisDiskon;
    }

    @Column(name="cara_hitung", length=1)
    public String getCaraHitung() {
        return caraHitung;
    }

    public void setCaraHitung(String caraHitung) {
        this.caraHitung = caraHitung;
    }
    
    @Column(name="batas")
    public Integer getBatas() {
        return this.batas;
    }
    
    public void setBatas(Integer batas) {
        this.batas = batas;
    }
    
    @Column(name="nilai", precision=12, scale=2)
    public BigDecimal getNilai() {
        return this.nilai;
    }
    
    public void setNilai(BigDecimal nilai) {
        this.nilai = nilai;
    }
    
    @Transient
    public Boolean getUpdated() {
        return updated;
    }

    public void setUpdated(Boolean updated) {
        this.updated = updated;
    }

    


}


